package cool.zhoujie.address.db;

import androidx.annotation.NonNull;
import androidx.room.Entity;
import androidx.room.Ignore;
import androidx.room.PrimaryKey;

import java.io.Serializable;

@Entity
public class Address implements Serializable {

    @PrimaryKey(autoGenerate = true)
    public int id;

    public String name;

    public String phone;

    public String region;

    public String detail;

    public boolean isDefault;

    public Address(int id, String name, String phone, String region, String detail, boolean isDefault) {
        this.id = id;
        this.name = name;
        this.phone = phone;
        this.region = region;
        this.detail = detail;
        this.isDefault = isDefault;
    }

    @Ignore
    public Address(String name, String phone, String region, String detail, boolean isDefault) {
        this.name = name;
        this.phone = phone;
        this.region = region;
        this.detail = detail;
        this.isDefault = isDefault;
    }

    @NonNull
    @Ignore
    @Override
    public String toString() {
        return "Address{" +
                "id=" + id +
                ", consigneeName='" + name + '\'' +
                ", consigneePhone='" + phone + '\'' +
                ", address_region='" + region + '\'' +
                ", address_detail='" + detail + '\'' +
                ", isDefault=" + isDefault +
                '}';
    }
}
